package xyz.xuminghai.javafx_learn.scene.effect;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.BoxBlur;
import javafx.scene.layout.BorderPane;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * 2023/7/6 16:17 星期四<br/>
 * 盒式模糊
 *
 * @author xuMingHai
 */
public class BoxBlurApp extends Application {

    private final BorderPane root = new BorderPane();

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Text text = new Text("BoxBlur");
        text.setFont(Font.font(50.0));

        BoxBlur boxBlur = new BoxBlur(23.0, 8.0, 1);

        text.setEffect(boxBlur);


        root.setCenter(text);
    }


    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(root, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
